package com.iecg.controller.weixin;


import com.iecg.api.dto.IecgWeixinTemplateDto;
import com.iecg.api.feign.RemoteWeixinService;
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("weixin/template" )
@Api(value = "weixin_template", tags = "Weixin发送模板消息")
public class WeixinTemplateController {

	private final RemoteWeixinService remoteWeixinService;


	@SysLog("推送模板消息")
	@PostMapping("/send")
	public R send(@RequestBody IecgWeixinTemplateDto iecgWeixinTemplateDto) {
		remoteWeixinService.send(iecgWeixinTemplateDto, SecurityConstants.FROM_IN);
		return R.ok();
	}

}
